#include <stdio.h>
#include "proto.h"
int main(int argc, char **argv)
{
	int tcp_socket;
	struct sockaddr_in server_addr;
	char buf[MSGSIZE] = {0};
	tcp_socket = socket (AF_INET, SOCK_STREAM, 0);
	if (-1 == tcp_socket){
		perror ("socket");
		exit (0);
	}
	server_addr.sin_family = AF_INET;
	server_addr.sin_port = htons (atoi(SERVER_PROT));
	inet_aton (SERVER_IP, &server_addr.sin_addr);
	if (-1 == connect(tcp_socket,(struct sockaddr *)&server_addr, sizeof (server_addr))){
		perror ("connect");
		goto ERROR;
	}
	write (tcp_socket, "yhy!", 4);

	read (tcp_socket, buf, MSGSIZE);
	puts (buf);
	return 0;
ERROR:
	close (tcp_socket);
}
